package Engine.RMI
{
    import Framework.Serialize.*;

    public class ERMICallModel extends Object
    {
        public var __value:int;
        private static const __T:Array = ["CallModelSync", "CallModelAsync"];
        private static var __values:Array = new Array();
        public static const _CallModelSync:int = 0;
        public static const CallModelSync:ERMICallModel = new ERMICallModel(_CallModelSync);
        public static const _CallModelAsync:int = 1;
        public static const CallModelAsync:ERMICallModel = new ERMICallModel(_CallModelAsync);

        public function ERMICallModel(param1:int)
        {
            this.__value = param1;
            __values[param1] = this;
            
        }

        public function value() : int
        {
            return this.__value;
        }

        public function toString() : String
        {
            return __T[this.__value];
        }

        public function equals(param1:Object) : Boolean
        {
            if (param1 == this)
            {
                return true;
            }
            var _loc_2:* = param1 as ERMICallModel;
            if (_loc_2 == null)
            {
                return false;
            }
            return this.__value == _loc_2.value();
        }

        public function hashCode() : int
        {
            return 5 * this.__value;
        }

        public function __write(param1:SerializeStream) : void
        {
            param1.writeByte(this.__value);
            
        }

        public static function convert(param1:int) : ERMICallModel
        {
            return __values[param1];
        }

        public static function __read(param1:SerializeStream) : ERMICallModel
        {
            var _loc_2:* = param1.readByte();
            if (_loc_2 < 0 || _loc_2 >= 2)
            {
                throw new MarshalException();
            }
            return ERMICallModel.convert(_loc_2);
        }

    }
}
